package com.zb.vo;

import com.zb.annotation.NumberPattern;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

/**
 * @Author WEN
 * @Date 2023/8/22 0022
 **/
@Data
@ApiModel("产品Boom子件对象")
public class ProductBoomChildVo {
    @ApiModelProperty(value = "Boom子件ID，新增不必传，修改必传")
    private Long id;

    @NotNull(message = "商品类型不能为空")
    @NumberPattern(regexp = "^(1|2)$", message = "商品类型不合法！")
    @ApiModelProperty(value = "商品类型：1-成品，2-备件", required = true)
    private Integer type;

    @NotNull(message = "商品ID不能为空")
    @ApiModelProperty(value = "商品ID", required = true)
    private Long goodsId;

    @NotNull(message = "商品规格ID不能为空")
    @ApiModelProperty(value = "商品规格ID")
    private Long goodsSpecId;

    @NotNull(message = "数量不能为空")
    @ApiModelProperty(value = "数量", required = true, example = "1")
    private Integer qty;

    @Length(max = 500, message = "备注限制500个字符以内")
    @ApiModelProperty(value = "备注")
    private String remark;
}
